package com.tdy.nht.doc.api;

import com.tdy.nht.common.Result;
import com.tdy.nht.common.ResultPage;
import com.tdy.nht.doc.domain.${modelName}DTO;
import com.tdy.nht.doc.domain.${modelName}Query;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
* @Description: $!{annotation}API组件
* @author: $!{author}
* @Date: ${createTime}
*/
@FeignClient(value = "tdy-nht-service")
public interface ${modelName}Api {

    /**
    * 查询$!{annotation}列表
    *
    * @param query 查询条件
    * @return 返回响应结果
    */
    @PostMapping(value = "/list${modelName}Page")
    ResultPage<${modelName}DTO> list${modelName}Page(@RequestBody ${modelName}Query query);


    /**
    * @Description: 根据id查询
    * @param: id 查询详情的id
    * @return: 响应结果
    */
    @GetMapping("/get${modelName}ById")
    Result<${modelName}DTO> get${modelName}ById(@RequestParam("id") Long id);

    /**
    * 批量删除$!{annotation}
    *
    * @param ids 记录id
    * @return 响应结果
    */
    @PostMapping("/remove${modelName}Batch")
    Result<Object> remove${modelName}Batch(@RequestBody List<Long> ids);

    #if($!saveMethod == '1')

        /**
        * 保存$!{annotation}
        *
        * @param $!{lowerModelName}DTO $!{annotation}实例
        * @return 响应结果
        */
        @PostMapping("/save${modelName}")
        Result<Object> save${modelName}(@RequestBody ${modelName}DTO $!{lowerModelName}DTO);
    #end
}
